dojo.declare("MVendorHomePg", wm.Page, {
    start: function() {

    },
    "preferredDevice": "phone",

    tbLogoutClick: function(inSender) {
        this.nclLogout.update();
        var mainPage = wm.Page.getPage("MobileMainPg");
        mainPage.vLoginCount = mainPage.vLoginCount + 1;

        wm.Page.getPage("MobileMainPg").ncLoginPg.update();
    },
    backClick: function(inSender) {



        if (this.vPageBack === 'NEW_ORDERS') {


            this.layerOrderToday.activate();

            wm.Page.getPage("MVendorOrderCurrentPg").layerOrder.activate();

        }
        //svUpdateOrderStatus
        if (this.vPageBack === 'NEW_ORDERS_ITEMS') {
            if (wm.Page.getPage("MVendorOrderCurrentPg")) {
                //    console.error(wm.Page.getPage("MVendorOrderCurrentPg").listCurrentOrders.selectedItem);
                //var orderId = wm.Page.getPage("MVendorOrderCurrentPg").listCurrentOrders.selectedItem.data.orderId;
                //wm.Page.getPage("MVendorOrderCurrentPg").svUpdateOrderStatus.input.setValue("orderId", orderId);
                //wm.Page.getPage("MVendorOrderCurrentPg").svUpdateOrderStatus.update();
            }
            this.layerOrderToday.activate();

            wm.Page.getPage("MVendorOrderCurrentPg").layerOrder.activate();


        }
        if (this.vPageBack === 'ORDER_HISTORY') {
            this.layerOrderHistory.activate();
            wm.Page.getPage("MVendorOrderHistoryPg").layerOrder.activate();

        }
        if (this.vPageBack === 'ITEMS') {
            this.layerMenuItems.activate();


        }


        if (this.vPageBack === 'VENDOR_ACCOUNT') {
            this.layerMyAccount.activate();


        }
    },
    tbServicesClick1: function(inSender) {

        this.vPageBack = 'NEW_ORDERS';

    },
    tbOrderHistoryClick1: function(inSender) {
        this.vPageBack = 'ORDER_HISTORY';
        if (wm.Page.getPage("MVendorOrderHistoryPg")) {

            wm.Page.getPage("MVendorOrderHistoryPg").svVendorOrderHistory.update();


        }

    },
    tbPastOrdersClick1: function(inSender) {
        this.vPageBack = 'ITEMS';
    },
    tbUpdateAccountClick1: function(inSender) {
        this.vPageBack = 'VENDOR_ACCOUNT';
    },
    _end: 0
});